﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="dlg_dept.aspx.cs" Inherits="Setting_dlg_dept" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>选择部门</title>
    <link href="../Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui-1.8.14/jquery-ui-1.8.14.custom.min.js" type="text/javascript"></script>
    <link href="../Scripts/dynatree-1.1.1/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/dynatree-1.1.1/jquery.dynatree.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#tree").dynatree({
                checkbox: true,
                <%if(selectMode == 1){ %>classNames: {checkbox: "dynatree-radio"},<%} %>
                selectMode: <%=selectMode %>,
                initAjax: {
                    url: "/setting/do_LoadDept.aspx",
                    data: { id: "0" }
                },
                onActivate: function (node) {
                },
                onLazyRead: function (node) {
                    node.appendAjax({ url: "/setting/do_LoadDept.aspx",
                        data: { "id": node.data.key }
                    });
                }
            });
        });
        function doSelect(){
            var selid = "";
            var selNodes = $("#tree").dynatree("getSelectedNodes");
            if(selNodes.length == 0)
                alert("请选择部门!");
            else{
                window.opener.recvSelectDept(selNodes);
                window.close();
            }
        }
    </script>
    <style type="text/css">
        #treeContainer{ height:350px; overflow:auto;}
        #bottomBar{ text-align:center; background-color:#eeeeee;}
    </style>
</head>
<body>
    <div id="treeContainer">
        <div id="tree">
        </div>
    </div>
    <div id="bottomBar"><input type="button" value=" 确定 " onclick="doSelect()" />&nbsp;<input type="button" value=" 取消 " onclick="self.close()" /></div>
</body>
</html>
